//
//  PhoneticReadingManager.h
//  ebook
//
//  Created by mt on 16/10/26.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <Foundation/Foundation.h>

@class PhoneticReadingManager;
@class AVSpeechUtterance;
@protocol PhoneticReadingManagerDelegate <NSObject>

@required
- (void)phoneticreadingManager:(PhoneticReadingManager *)readingManager didFinishSpeechUtterance:(AVSpeechUtterance *)utterance;
@optional
- (void)phoneticreadingManager:(PhoneticReadingManager *)readingManager didStartSpeechUtterance:(AVSpeechUtterance *)utterance;
- (void)phoneticreadingManager:(PhoneticReadingManager *)readingManager didPauseSpeechUtterance:(AVSpeechUtterance *)utterance;
- (void)phoneticreadingManager:(PhoneticReadingManager *)readingManager didContinueSpeechUtterance:(AVSpeechUtterance *)utterance;
- (void)phoneticreadingManager:(PhoneticReadingManager *)readingManager didCancelSpeechUtterance:(AVSpeechUtterance *)utterance;
- (void)phoneticreadingManager:(PhoneticReadingManager *)readingManager willSpeakRangeOfSpeechString:(NSRange)characterRange utterance:(AVSpeechUtterance *)utterance;

@end

@interface PhoneticReadingManager : NSObject

@property(nonatomic, weak) id<PhoneticReadingManagerDelegate>delegate;

+ (instancetype)shareManager;

@property(nonatomic) BOOL isPlaying;                    //是否正在播放
@property(nonatomic, copy) NSString *language;          //语种
@property(nonatomic) int rate;                          //语速
@property(nonatomic) NSTimeInterval postUtteranceDelay; //间隔

- (void)startPhoneticReadingText:(NSString *)content;//开始
- (void)pausePhoneticReading;                        //暂停
- (void)continuePhoneticReading;                     //继续
- (void)stopPhoneticReading;                         //停止

@end
